﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Ribbon;

using ObjectEditor.UserControls;

namespace EQEmu.PathingPlugin
{
    /// <summary>
    /// Interaction logic for PathingRibbonTab.xaml
    /// </summary>
    public partial class PathingRibbonTab : RibbonTab, IDynamicRibbonTab
    {
        public PathingRibbonTab(PathingRibbonTabViewModel viewModel)
        {
            InitializeComponent();
            DataContext = viewModel;
        }

        public PathingRibbonTabViewModel ViewModel
        {
            get
            {
                return DataContext as PathingRibbonTabViewModel;
            }
        }

        private void RibbonGallery_SelectionChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            var node = e.NewValue as EQEmu.Pathing.Node;
            if (node != null)
            {
                ViewModel.SelectedNode = node;
            }
        }
    }
}
